<template>
    <div>
        <div>
            <el-input class="searchInput" 
                    clearable
					@clear="keywordClear"
                    v-model="keyword"
                    placeholder="请输入公司关键字进行搜索..."
                    @keydown.enter.native="doSearch"
                    prefix-icon="el-icon-search">
            </el-input>
            <el-button icon="el-icon-search" type="primary" @click="doSearch">搜索</el-button>
        </div>
        <div style="margin-top: 10px">
			<el-table :data="baseEva"
                    stripe
                    border
                    style="width: 32%">
				<el-table-column prop="name"
                                    label="基地"
                                    width="250">
				</el-table-column>
				<el-table-column prop="city"
                                label="所在城市"
                                width="80">
				</el-table-column>
				<el-table-column prop="thisYearScore"
                                label="评分">
				</el-table-column>
			</el-table>
		</div>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                keyword:'',
                baseEva:[],
            }
        },
        mounted(){
            this.initBaseEva();
        },
        methods:{
            initBaseEva() {
                this.getRequest('/base/assess/?keyword=' + this.keyword).then(resp => {
                    if(resp) {
                        this.baseEva = resp;
                    }
                })
            },
            doSearch(){
                this.initBaseEva();
            },
            keywordClear() {
                this.initBaseEva();
            },
        }
    }
</script>

<style scoped>
.searchInput{
        width: 300px;
        margin-right: 8px;
    }
</style>